#ifndef LRCPAGE_H
#define LRCPAGE_H

#include <QWidget>

// lrc行歌词结构
struct LrcLine
{
    LrcLine(qint64 time, const QString &text)
        : lrcTime(time), lrcText(text)
    {}
    qint64 lrcTime;
    QString lrcText;
};

namespace Ui {
class LrcPage;
}

class LrcPage : public QWidget
{
    Q_OBJECT

public:
    explicit LrcPage(QWidget *parent = nullptr);
    ~LrcPage();

    bool parseLrcFile(const QString& lrcFilePath);
    void showLrcWordLine(qint64 time);
    int getLrcLineIndex(qint64 time);
    QString getLrcWordByIndex(int index);
    void setLrcName(const QString& name);
    void setLrcSinger(const QString& singer);
    void setLrcAlbum(const QString& album);

signals:
    void lrcPageMoveDown();

private:
    Ui::LrcPage *ui;

    QVector<LrcLine> lrcLines;
};

#endif // LRCPAGE_H
